/**
 * 
 */
package rlm;

import java.awt.Container;

/**
 * 
 * 
 * created on 12:02:13 AM
 * 
 * @author robot
 */
public class DefaultLayoutData implements LayoutData {
	private int height;
	private int width;
	private double aspertRatio;
	private Container parent;

	/**
	 * Default constractor, to be a good bean
	 */
	public DefaultLayoutData() {
		// nothing really
	}

	/**
	 * The best constructor to use, since it calculates everything that's in the
	 * default data
	 * 
	 * @param container
	 */
	public DefaultLayoutData(Container container) {
		if (container != null) {
			setParent(container);
			setWidth(parent.getWidth());
			setHeight(parent.getHeight());
			setAspertRatio(parent.getWidth(), parent.getHeight());
		}
	}

	/**
	 * @param width2
	 * @param height2
	 */
	public void setAspertRatio(int width2, int height2) {
		setAspertRatio(width2 / (height2 + 0.0));
	}

	public int getHeight() {
		return height;
	}

	public void setHeight(int height) {
		this.height = height;
	}

	public int getWidth() {
		return width;
	}

	public void setWidth(int width) {
		this.width = width;
	}

	public double getAspertRatio() {
		return aspertRatio;
	}

	public void setAspertRatio(double aspertRatio) {
		this.aspertRatio = aspertRatio;
	}

	public Container getParent() {
		return parent;
	}

	public void setParent(Container parent) {
		this.parent = parent;
	}
}
